// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------

import request from '@/libs/request';

/**
 * @description 全部合同列表
 * @param {Object} param data {Object} 传值参数
 */
export function ListApi(data) {
  return request({
    url: 'contract/list',
    method: 'get',
    params: data,
  });
}


/**
 * @description 到期合同列表
 * @param {Object} param data {Object} 传值参数
 */
export function ListExpireApi(data) {
  return request({
    url: 'contract/list_expire',
    method: 'get',
    params: data,
  });
}

/**
 * @description 上级列表
 * @param {Object} param data {Object} 传值参数
 */
export function ListCateApi() {
  return request({
    url: 'contract/dic',
    method: 'get',
    params: {},
  });
}

/**
 * @description 保存
 * @param {Object} param data {Object} 传值对象
 */
export function saveApi(data) {
  return request({
    url: `contract/save`,
    method: 'post',
    data,
  });
}

/**
 * @description 合同管理-- 详情
 */
export function detailApi(id) {
  return request({
    url: `contract/detail/${id}`,
    method: 'get',
  });
}

/**
 * @description 导出合同
 * @param {Object} param data {Object} 传值参数
 */
export function exportContractApi(date) {
  return request({
    url: 'export/contract',
    method: 'get',
    params: date,
  });
}

/**
 * @description 获取统计数据
 * @param {Object} param data {Object} 传值参数
 */
export function ListIndexApi() {
  return request({
    url: 'contract/indexdata',
    method: 'get',
    params: {},
  });
}